/********************************************************/
/*	Copyright (C) 2016 Gong Li Bin			*/
/*	Project:	GlbCloud			*/
/*	Author:		gong_libin			*/
/*	Date:		2012_01_09			*/
/*	File:		MrEpoll.h			*/
/********************************************************/

#ifndef _MREPOLL_H
#define	_MREPOLL_H

#include "MrTcp.h"
#include <sys/epoll.h>

#define	MR_EVENT			256
#define	MR_EPOLL			10000

class CMrEpoll
{
public:
	CMrEpoll();
	virtual ~CMrEpoll();

	void MrEpollClose();
	int MrEpollUdpInit();
	void MrEpollUdpWait();
	void MrEpollTcpWait();
	int MrEpollGetEpoll();
	int MrEpollGetListen();
	int MrEpollTcpInit(char* pszPort);
	void MrEpollSetFunction(int (*pFunction)(int));
	int MrEpollCtlAdd(struct epoll_event* pstEpoll);
	int MrEpollCtlDel(struct epoll_event* pstEpoll);

private:
	int m_iEpoll;
	CMrTcp m_CListen;
	int (*m_pFunction)(int);

};

#endif /* _MREPOLL_H */
